package com.bw.home.model.api

import com.bw.home.model.entity.CommentEntity
import com.bw.net.entity.BaseRespEntity
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * @author:created by hahajing
 * 时间：2024/5/6 0006
 * 企鹅号:444511958
 * 描述:
 */
interface CommentApi {
    @POST("comment/publishComment")
    suspend fun pubishComment(@Body entity:CommentEntity):BaseRespEntity<CommentEntity>

//    @FormUrlEncoded
    @DELETE("comment/removeComment")
    suspend fun removeComment(@Field("id") id:Int):BaseRespEntity<Boolean>

    @GET("comment/getCommentByUserId")
    suspend fun getComments(@Query("datatype")  datatype:Int,@Query("itemid") itemid:String):BaseRespEntity<List<CommentEntity>>

    @FormUrlEncoded
    @POST("comment/agree")
    suspend fun agreeComment(@Field("commentid")  commentid:Int):BaseRespEntity<Boolean>

    @FormUrlEncoded
    @POST("comment/unAgree")
    suspend fun unagreeComment(@Field("commentid")  commentid:Int):BaseRespEntity<Boolean>
}